cmake_minimum_required(VERSION 2.8.3)
project(moying_proto)
add_compile_options(-std=c++11)

find_package(catkin REQUIRED)

find_package(Protobuf REQUIRED)

catkin_package( 
  INCLUDE_DIRS include 
  LIBRARIES moying_proto
  CATKIN_DEPENDS 
)  
 
include_directories(
  include   
  ./   
  ${catkin_INCLUDE_DIRS}    
)  
      
include(cmake/GenerateProtoFiles.cmake)
generate_cpp_pb_files() 
      
add_library(           
  ${PROJECT_NAME} 
  ${proto_cc_files}     
)      
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} ${Protobuf_LIBRARIES})        
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Protobuf_LIBRARIES})

#配置包含的头文件（安装后可在/opt/ros/kinetic/include/${PROJECT_NAME}路径下找到该头文件）
install(DIRECTORY include/${PROJECT_NAME}/
  
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
              
)
   
## Mark executables and/or libraries for installation
 install(TARGETS ${PROJECT_NAME} 
   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
 )